const St = imports.gi.St;
const Signals = imports.signals;
+const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Slider = imports.ui.slider;
return 'audio-volume-high-symbolic';
return 'audio-volume-medium-symbolic';
}
+ },
+
+ getLevel: function() {
+ if (!this._stream)
+ return null;
+
+ return 100 * this._stream.volume / this._control.get_vol_max_norm();
}
});
Signals.addSignalMethods(StreamSlider.prototype);
getIcon: function() {
return this._output.getIcon();
+ },
+
+ getLevel: function() {
+ return this._output.getLevel();
}
});
},
_onScrollEvent: function(actor, event) {
- return this._volumeMenu.scroll(event);
+ let result = this._volumeMenu.scroll(event);
+ if (result == Clutter.EVENT_PROPAGATE || this.menu.actor.mapped)
+ return result;
+
+ let gicon = new Gio.ThemedIcon({ name: this._volumeMenu.getIcon() });
+ let level = this._volumeMenu.getLevel();
+ Main.osdWindowManager.show(-1, gicon, null, level);
+ return result;
}
});